﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Main.Master" CodeBehind="PQRManagement_HDR.aspx.cs"
    Inherits="VSM.PQRManagement_HDR" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function CheckAll(oCheckbox) {
            var GridView2 = document.getElementById("<%=grdItem.ClientID %>");
            for (i = 1; i < GridView2.rows.length; i++) {
                GridView2.rows[i].cells[0].getElementsByTagName("INPUT")[0].checked = oCheckbox.checked;
            }
        }

        function openServiceDetail(gID) {
            var url = "P_PQR.aspx?GeneralID=" + gID
            Main.openCustomDialog(url, 950, 700);
        };
    </script>
    <div>
        <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <table border="0" width="100%" style="background-color: #D1D4D8;">
                    <tr>
                        <td class="FormLineItemAlt" style="width: 10%">
                            From Date:
                        </td>
                        <td class="FormLineItemAlt" style="width: 35%">
                            <asp:TextBox ID="txtFromDate" runat="server" Width="35%"></asp:TextBox>
                            <asp:ImageButton ID="ImageButton1" runat="Server" AlternateText="Click to show calendar"
                                ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtFromDate"
                                PopupButtonID="ImageButton1" Format="dd/MM/yyyy">
                            </cc1:CalendarExtender>
                            ToDate:
                            <asp:TextBox ID="txtToDate" runat="server" Width="35%"></asp:TextBox>
                            <asp:ImageButton ID="ImageButton2" runat="Server" AlternateText="Click to show calendar"
                                ImageUrl="~/Images/Calendar_scheduleHS.png" />
                        </td>
                        <td class="FormLineItemAlt" style="width: 10%">
                            &nbsp;
                        </td>
                        <td class="FormLineItemAlt" style="width: 35%">
                            <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtToDate"
                                PopupButtonID="ImageButton2" Format="dd/MM/yyyy">
                            </cc1:CalendarExtender>
                        </td>
                    </tr>
                    <tr>
                        <td class="FormLineItemAlt" style="width: 10%">
                            Status:
                        </td>
                        <td class="FormLineItemAlt" style="width: 35%">
                            <asp:DropDownList ID="ddlStatus" runat="server" Width="35%">
                            </asp:DropDownList>
                        </td>
                        <td class="FormLineItemAlt" style="width: 15%">
                            &nbsp;
                        </td>
                        <td class="FormLineItemAlt" style="width: 35%">
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <table border="0" width="100%" style="background-color: #D1D4D8;">
                    <tr>
                        <td class="FormLineItemAlt">
                            <asp:Button ID="btn_Filter" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                                Height="30px" Text="Filter" Width="100px" OnClick="btn_Filter_Click" CausesValidation="false" />
                            <asp:Button ID="btn_Reject" runat="server" BackColor="#1B7FC2" 
                                ForeColor="#FFFFFF" Height="30px" onclick="btn_Reject_Click" Text="Reject" 
                                Width="130px" />
                            <asp:Button ID="btn_Submit" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                                Height="30px" Text="Submit To VSM" Width="130px" 
                                OnClick="btn_Submit_Click" />
                        </td>
                    </tr>
                </table>
                <br />
                <div style="height: 490px; overflow: scroll">
                    <table style="width: 100%; border: 1px;" cellpadding="3" cellspacing="0">
                        <tr>
                            <td colspan="2" style="text-align: center;">
                                <asp:GridView ID="grdItem" runat="server" CssClass="GridInner" Width="100%" BorderColor="White"
                                    BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                                    HeaderStyle-Height="27px" OnSorting="grdItem_Sorting" OnRowDataBound="grdItem_RowDataBound">
                                    <RowStyle BackColor="#D9E0ED" ForeColor="Black" BorderColor="White" BorderWidth="2px"
                                        Height="25px" />
                                    <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" Height="25px" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Action">
                                            <ItemStyle HorizontalAlign="Center" Width="60px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Button ID="btnView" runat="server" Width="50px" Text="View" BackColor="#1B7FC2"
                                                    ForeColor="#FFFFFF" OnClientClick='<%#"openServiceDetail(\"" +Eval("GeneralID") +"\");" %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField>
                                            <ItemStyle HorizontalAlign="Center" Width="2%" />
                                            <HeaderTemplate>
                                                <%--<asp:CheckBox ID="chkheader" runat="server" onclick="CheckAll(this)" />--%>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkChild" runat="server" Visible='<%# (Convert.ToInt32(Eval("Status")) == 1 || Convert.ToInt32(Eval("Status")) == 6)? true: false  %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="ID" SortExpression="ItemCode">
                                            <ItemStyle HorizontalAlign="left" Width="25px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbGeneralID" runat="server" Text='<%# Bind("GeneralID") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="ID">
                                            <ItemStyle HorizontalAlign="Left" Width="30px" />
                                            <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbPQRID" runat="server" Text='<%# Bind("QPRID") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Service Date">
                                            <ItemStyle HorizontalAlign="Left" Width="60px" />
                                            <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbDate" runat="server" Text='<%# Bind("ServiceDate","{0:dd/MM/yyyy}") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Failure Date">
                                            <ItemStyle HorizontalAlign="Left" Width="60px" />
                                            <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbFailureDate" runat="server" Text='<%# Bind("FailureDate","{0:dd/MM/yyyy}") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="VIN" SortExpression="ItemName">
                                            <ItemStyle HorizontalAlign="left" Width="140px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbVIN" runat="server" Text='<%# Bind("VIN") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Customer" SortExpression="InStock">
                                            <ItemStyle HorizontalAlign="left" Width="150px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbCustomerName" runat="server" Text='<%# Bind("CustomerName") %>'
                                                    BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Sequence No.">
                                            <ItemStyle HorizontalAlign="Left" />
                                            <HeaderStyle VerticalAlign="Middle" Width="80px" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbSeqNo" Style="text-align: left" runat="server" Text='<%# Bind("SeqNo") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Condition Code">
                                            <ItemStyle HorizontalAlign="Left" />
                                            <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbCondCode" Style="text-align: left" runat="server" Text='<%# Bind("ConditionCode") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Status">
                                            <ItemStyle HorizontalAlign="Left" />
                                            <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbStatus" Style="text-align: left" runat="server" Text='<%# Bind("StatusName") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--<asp:TemplateField HeaderText="VSM Status">
                                            <ItemStyle HorizontalAlign="Left" />
                                            <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbVSMStatus" Style="text-align: left" runat="server" Text='<%# Bind("VSMStatusName") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>--%>
                                    </Columns>
                                    <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
                                    <SelectedRowStyle BackColor="#9471DE" Font-Bold="true" ForeColor="White" />
                                    <HeaderStyle BackColor="#6095C9" Font-Bold="true" ForeColor="#ffffff" Font-Overline="False"
                                        Height="27px" VerticalAlign="Bottom" />
                                    <EmptyDataTemplate>
                                        No Data Found.
                                    </EmptyDataTemplate>
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: center;">
                            </td>
                        </tr>
                    </table>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
